package com.smartleanx.module.hrm.dal.mysql.examine.examineProcess;

import java.util.*;

import com.smartleanx.framework.common.pojo.PageResult;
import com.smartleanx.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.smartleanx.framework.mybatis.core.mapper.BaseMapperX;
import com.smartleanx.module.hrm.dal.dataobject.examine.examineProcess.ExamineProcessDO;
import org.apache.ibatis.annotations.Mapper;
import com.smartleanx.module.hrm.controller.admin.examine.examineProcess.vo.*;

/**
 * 记录 Mapper
 *
 * @author 
 */
@Mapper
public interface ExamineProcessMapper extends BaseMapperX<ExamineProcessDO> {

    default PageResult<ExamineProcessDO> selectPage(ExamineProcessPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExamineProcessDO>()
                .eqIfPresent(ExamineProcessDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ExamineProcessDO::getRecordEmployeeId, reqVO.getRecordEmployeeId())
                .eqIfPresent(ExamineProcessDO::getReviewEmployeeId, reqVO.getReviewEmployeeId())
                .eqIfPresent(ExamineProcessDO::getAppealReason, reqVO.getAppealReason())
                .eqIfPresent(ExamineProcessDO::getRejectReason, reqVO.getRejectReason())
                .eqIfPresent(ExamineProcessDO::getRejectNode, reqVO.getRejectNode())
                .eqIfPresent(ExamineProcessDO::getAppealNode, reqVO.getAppealNode())
                .orderByDesc(ExamineProcessDO::getId));
    }

}